#include <iostream>
#include <cstring>
#include <string>
using namespace std;

int a[1005][1005];
int n, m, k;
int p;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin >> n >> m >> k;
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            cin >> p;
            a[p][j] = 1;
        }
    }
    for (int i = 1; i <= k; i++)
    {
        for (int j = 1; j <= m; j++)
            a[i][j] += a[i][j - 1];
        cout << a[i][m] << " ";
    }
    return 0;
}